<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>


<div class="layui-fluid" id="app">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">


            <div class="layui-card" >
                <!--<div class="layui-card-header">云存储</div>-->
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">

                            <li class="layui-this">七牛云</li>

                        </ul>
                        <div class="layui-tab-content">


                            <div class="layui-tab-item layui-show">
                                <div class="layui-form" wid150="" lay-filter="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">AccessKey</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="ak" value="{$item.ak}" lay-verify="required"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">SecretKey</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sk" lay-verify="required"
                                                   value="{$item.sk}"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <!--<div class="layui-form-item">-->
                                        <!--<label class="layui-form-label">域名协议</label>-->
                                        <!--<div class="layui-input-block">-->
                                            <!--<input type="text" name="" lay-verify="required"-->
                                                   <!--value="https" readonly-->
                                                   <!--class="layui-input">-->
                                        <!--</div>-->
                                    <!--</div>-->


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">空间域名</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="domain" lay-verify="required"
                                                   value="{$item.domain}" placeholder="http://xxxxxxxxx"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">空间名称</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="bk" lay-verify="required"
                                                   value="{$item.bk}"
                                                   class="layui-input">
                                        </div>
                                    </div>


                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">水印参考</label>
                                        <div class="layui-input-block">
                                            <textarea name="" class="layui-textarea" readonly>请到七牛存储空间->图片样式：添加此样式名称，并进行相应设置 处理接口:<br>imageMogr2/auto-orient/thumbnail/1080x1080>/blur/1x0/quality/75|watermark/2/text/VGhpbmtDTUY=/font/5b6u6L2v6ZuF6buR/fontsize/500/fill/I0ZGRkZGRg==/dissolve/100/gravity/SouthEast/dx/10/dy/10
                                            </textarea>
                                        </div>
                                    </div>

                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">缩略图120x120</label>
                                        <div class="layui-input-block">
                                            <textarea name="" class="layui-textarea" readonly>请到七牛存储空间->图片样式：添加此样式名称，并进行相应设置 处理接口:<br>imageMogr2/auto-orient/thumbnail/!120x120r/gravity/Center/crop/120x120/quality/100/interlace/0
                                            </textarea>
                                        </div>
                                    </div>


                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">样式-缩略图640x640</label>
                                        <div class="layui-input-block">
                                            <textarea name="" class="layui-textarea" readonly>请到七牛存储空间->图片样式：添加此样式名称，并进行相应设置 处理接口:<br>imageMogr2/auto-orient/thumbnail/!640x640r/gravity/Center/crop/640x640/quality/100/interlace/0
                                            </textarea>
                                        </div>
                                    </div>


                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="set_website">确认保存
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>

                        </div>
                    </div>
                </div>
            </div>


        </div>


    </div>
</div>

<script>


    layui.use(['form'], function () {
        var $ = layui.$
            , layer = layui.layer
            , form = layui.form;

        //网站设置
        form.on('submit(set_website)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('oss')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2}, function () {
                        location.reload();
                    })
                    return false;
                }

            });
            return false;
        });


    });

</script>
</body>
</html>




